package com.yx.feign.api;

import com.yx.feign.impl.UserServiceImpl;
import com.yx.vo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Classname UserService
 * @Date 2021/07/06 12:01
 * @Author by yx
 * @Description TODO:
 */
@FeignClient(
        name = "shop-user", // 服务名称
        path = "/user", // namespace
        fallback = UserServiceImpl.class // 本地降级
)
public interface UserService {

    @PostMapping("/addUser")
    public Boolean addUser(@RequestBody User user);

    @GetMapping("/getUserList")
    public List<User> getUserList();

    @PostMapping("/queryUserList")
    List<User> queryUserList(@RequestBody User user);

    @GetMapping("/updateUser/{id}")
    public User getUser(@PathVariable("id") Integer id);

    @PostMapping("/updateUser")
    Boolean updateUser(@RequestBody User user);

    @PostMapping("/deleteUser")
    boolean deleteUsers(@RequestBody int[] ids);

    @GetMapping("/deleteUserById/{id}")
    Boolean deleteUserById(@PathVariable("id") Integer id);
}